<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="../include/tag.jsp"%>
<!DOCTYPE html>
<html lang="zh">
<head>
<title>手机官网</title>
<link rel="stylesheet" href="${ctx}/css/common/list.css">
<link rel="stylesheet" href="${ctx}/css/common/table.css">
<%@include file="../include/commonFile.jsp"%>
</head><body>
<!--头部-->
<%@include file="../include/header.jsp"%>
<div class="index-outside">
	<%@include file="../include/sidebar.jsp"%>
	<!--内容-->
	<section>
		<div class="section-main">
			<form class="layui-form" action="${ctx}/subject/subject/subjectList.do" id="myForm" method="post">
				<input type="hidden" name="pageNo" id="pageNo" />
<!-- 				<div class="f-search-bar"> -->
<!-- 					<div class="search-container"> -->
<!-- 						<ul class="search-form-content"> -->
<!-- 							<li class="form-item-inline"><label class="search-form-lable">专题名称</label> -->
<!-- 								<div class="layui-input-inline"> -->
<%-- 									<input type="text" name="name" autocomplete="off" class="layui-input" value="${subject.name}" placeholder="请输入查询专题名称"> --%>
<!-- 								</div></li> -->
<!-- 							<li class="form-item-inline"> -->
<!-- 								<div class="sub-btns"> -->
<!-- 									<a class="layui-btn layui-btn-danger" href="javascript:submitFunction('#myForm')">确定</a> -->
<!-- 									<a class="layui-btn layui-btn-normal" href="javascript:resetFunction('#myForm')">重置</a> -->
<!-- 								</div> -->
<!-- 							</li> -->
<!-- 						</ul> -->
<!-- 						<ul class="search-form-content"> -->
<!-- 							<li class="form-item"><label class="search-form-lable">发布时间</label> -->
<!-- 								<div class="check-btn-inner"> -->
<%-- 									<a id="all" href="javascript:void(0);" onclick="setTimeType($(this),0,'#myForm')" ${empty input.timeType || input.timeType == 0 ? 'class="active"' : ''}>全部</a> --%>
<%-- 									<a href="javascript:void(0);" onclick="setTimeType($(this),1,'#myForm')" ${input.timeType == 1 ? 'class="active"' : ''}>今天</a> --%>
<%-- 									<a href="javascript:void(0);" onclick="setTimeType($(this),2,'#myForm')" ${input.timeType == 2 ? 'class="active"' : ''}>本周内</a> --%>
<%-- 									<a href="javascript:void(0);" onclick="setTimeType($(this),3,'#myForm')" ${input.timeType == 3 ? 'class="active"' : ''}>本月内</a> --%>
<%-- 									<input type="hidden" name="timeType" value="${input.timeType}" /> --%>
<!-- 								</div> -->
<!-- 								<div class="layui-inline"> -->
<!-- 									<div class="layui-input-inline"> -->
<%-- 										<input class="layui-input" type="text" name="createStart" value="${input.createStart}" placeholder="开始日" onclick="layui.laydate({elem: this})"> --%>
<!-- 									</div> -->
<!-- 									- -->
<!-- 									<div class="layui-input-inline"> -->
<%-- 										<input class="layui-input" type="text" name="createEnd" value="${input.createEnd}" placeholder="截止日" onclick="layui.laydate({elem: this})"> --%>
<!-- 									</div> -->
<!-- 								</div> -->
<!-- 							</li> -->
<!-- 						</ul> -->
<!-- 					</div> -->
<!-- 				</div> -->
			</form>
			<div class="c-time-list-content">
				<ul>
					<c:if test="${page.totalCount == 0}">
						<div class="f16 tc mt15">还没有数据，请点击右上角的“发布官网”，发布和编辑内容</div>
					</c:if>
					<c:forEach var="subject" items="${subjects}">
						<li>
							<div class="detail-content">
								<a href="${ctx}/subject/subject/subjectDetail.do?id=${subject.id }" class="act-logo common-img">
									<img src="<c:if test="${ subject.picture!= null}">${subject.picture}?imageMogr2/auto-orient/crop/200x150</c:if>" alt="" onerror="txz.errImg(this)" onload="txz.imgLoad(this)">
								</a>
								<div class="detail">
									<div class="act-title">
										<a title="${subject.name }" href="${ctx}/subject/subject/subjectDetail.do?id=${subject.id }" class="title f18 ell db">${subject.name }</a>
									</div>
									<div class="">
										<p class="act-price">
											<span style="margin-right: 20px;"> 栏目数量：<b class='active-red'>${fn:length(subject.subjectApplies)}</b></span>
											<c:if test="${sessionScope.newCurrentUser.id != subject.memberId}">
												<span>发布者：<b class="active-red">${subject.memberName}</b></span>
											</c:if>
										</p>
										<p class="start-time ell" title="${subject.remarks }">描述：${subject.remarks }</p>
										<p class="act-price">
											发布时间：
											<fmt:formatDate value="${subject.createDate}" pattern="yyyy-MM-dd HH:mm" />
										</p>
									</div>
									<div class="opts-btns tb-opts" style="width:475px;">
										<div class="comm-opts">
											<a class="qr-btn" href="javascript:txz.openQrDialog({
												title:'扫码二维码可预览分享',
												detailList:[{
													title:'专题详情二维码',
													url:'${subject.qrCodeMap.qrCode}',
													link:'${subject.qrCodeMap.qrCodeContent}'
												}]
											})"><i class="iconfont icon-qrcode btn-icon"></i> 二维码</a>
											<a href="${ctx}/subject/subject/publishSubject.do?id=${subject.id }" target="_self"><i class="iconfont icon-edit btn-icon"></i> 编辑</a>
											<a href="javascript:txz.deleteObject('确定要删除吗？','${ctx}/subject/subject/delete.do?id=${subject.id}','该专题下已有栏目，不能删除')">
												<i class="iconfont icon-delete btn-icon"></i> 删除
											</a>
<%--											<a href="javascript:txz.expireCheck('', function() { confirmCopy('${subject.id}') })"><i class="iconfont icon-copy btn-icon"></i>复制手机官网</a>--%>
											<a href="${ctx}/subject/apply/applyList.do?subjectId=${subject.id }" target="_self"> <i class="iconfont icon-peoplelist btn-icon"></i> 栏目管理</a>
										</div>
									</div>
								</div>
							</div>
						</li>
					</c:forEach>
				</ul>
				<div class="f-def-dialog linkDialog">
					<div class="f-dialog-shadow"></div>
					<div class="f-dialog-content" style="width: 490px!important;height: auto!important;">
						<span class="close-icon"><i class="iconfont icon-close"></i></span>
						<div class="dialog-detail">
							<p class="f16 gray" id="dialog_title"></p>
							<div style="width: auto!important;margin: 0px auto;margin-top: 10px;padding-left: 20px;padding-right: 20px;">
								<div id="dialog_content" class="f16" style="word-wrap: break-word;margin: 0px auto;line-height: 30px;"></div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="page-content">
				<div id="page_content" class="page-container"></div>
			</div>
		</div><!--底部-->
		<%@include file="../include/footer.jsp"%>
	</section>
</div>

 <script type="text/javascript" src="${ctx}/script/common/table_option.js"></script>
<script type="text/javascript" src="${ctx}/script/common/list.js"></script>
<script type="text/javascript">
    $(function () {
// 加载分页
        loadPageNew({elem: 'page_content',totalCount: '${page.totalCount}',limit: '${page.limit}',page: '${page.page}'});
    })

	function confirmCopy(subjectId) {
		var confirmIndex = layer.confirm('确认复制手机官网所有内容吗?',{title:'系统提示'},function(index){
			layer.close(confirmIndex);
			copySubject(subjectId);
		});
	}

    function openHelpDialog() {
        txz.openHelpDialog({
            title: '手机效果预览',
            describe: '上传封面、建立栏目、填充栏目内容，即可创建手机官网，用户在手机可以查看微网站信息。',
            detailList: [{
                text: '1/手机官网',
                url: '${ctx}/image/dialog/sub_1.png'
            }, {
                text: '2/文章列表',
                url: '${ctx}/image/dialog/sub_2.png'
            }, {
                text: '3/文章详情',
                url: '${ctx}/image/dialog/sub_3.png'
            }]
        })
    }

	function copySubject(subjectId){
		var index = layer.load(1);
		$.post('${ctx}/subject/subject/copySubject.do?subjectId='+subjectId,function(res){
			layer.close(index);
			if(res.success == true){
                util.layerMsgSuccess("成功", function () {
					window.location.reload();
				});
			}else{
				util.layerMsgError("失败")
			}
		});
	}
</script>
<script type="text/javascript">
	txz.initHeader({
		nav:[{
			name: '手机官网',
			curr: true
		}],
        info: '<span class="f14 gray">' +
        '手机官网是一个可以自定义栏目、封面和风格，简单快速进行企业微型网站搭建的功能。</span>\n' +
        '<a href="javascript:openHelpDialog()" class="red ml10"><i class="iconfont icon-mobile"></i>手机端效果</a>\n' +
        '<a href="${ctx}/help/help/list.do?id=f1e81fe255ed4a2a8978ff86b54287a6" target="_blank" class="red ml10"><i class="iconfont icon-book"></i>帮助教程</a>',
		btns:[{
			name: '发布官网',
			icon: 'add',
			href: '${ctx}/subject/subject/publishSubject.do',
            isCheckExpire: true
		}]
	});
</script>
</body>
</html>